package org.lyl.taobao.service;

import org.lyl.taobao.api.IShopCartService;
import org.lyl.taobao.api.entity.ShopCart;
import org.lyl.taobao.api.utils.DruidConnectionUtils;
import org.lyl.taobao.dao.IShopCartDao;
import org.lyl.taobao.dao.impl.ShopCartDaoImpl;

import java.util.List;

/**
 * @Author: Re
 * @Date: 2021/4/7 17:33
 */
public class ShopCartServiceImpl implements IShopCartService {
    DruidConnectionUtils druidConnectionUtils=new DruidConnectionUtils();
    IShopCartDao iShopCartDao = new ShopCartDaoImpl();
    public boolean addShopCart(ShopCart shopCart) {
        return iShopCartDao.addShopCart(druidConnectionUtils.getConnection(),shopCart);
    }

    public List<Integer> checkC_IdByUserId(Integer userId) {
        return iShopCartDao.checkC_IdByUserId(druidConnectionUtils.getConnection(),userId);
    }

    public boolean deleteShopCart(Integer userId, Integer c_Id) {
        return iShopCartDao.deleteShopCart(druidConnectionUtils.getConnection(),userId,c_Id);
    }
}
